<ui:composition template="/admin/templates/ui2.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">

	<ui:define name="content">
		<div class="entry">
			<p:toolbar>
				<p:toolbarGroup>
					<h:outputLabel style="padding-left: 15px;"
						value="#{commonMsg.currentPositionLabel}大伙都订的那几天"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
					<p:button outcome="/admin/order/orderSummaryList" value="瞅瞅每天有几个"></p:button>
				</p:toolbarGroup>

				<p:toolbarGroup align="right">
					<p:separator />
					<p:button outcome="/admin/order/userOrderList" value="返回订单列表"></p:button>
				</p:toolbarGroup>
			</p:toolbar>
			<h:form id="form">
				<p:spacer></p:spacer>
				<p:panel id="filters">
					<h:panelGrid columns="8" styleClass="filter-grid"
						rowClasses="filter-row"
						columnClasses="filter-col1,filter-col2,filter-col3">
						<h:outputLabel value="菜单编号："></h:outputLabel>
						<h:inputText value="#{orderDetailList.cookbook_id}"></h:inputText>
						<h:outputLabel value="从哪天到哪天的："></h:outputLabel>
						<ui:fragment>
							<p:calendar value="#{orderDetailList.startDate}"
								pattern="yyyy-MM-dd" navigator="true" showButtonPanel="true"></p:calendar>
							<p:calendar id="date" value="#{orderDetailList.endDate}"
								pattern="yyyy-MM-dd" navigator="true" showButtonPanel="true"></p:calendar>
						</ui:fragment>
						<h:outputText value="操作："></h:outputText>
						<ui:fragment>
							<p:commandButton update="dataTable" process="filters"
								value="#{commonMsg.searchLabel}"></p:commandButton>
							<p:button value="#{commonMsg.resetLabel}"
								onclick="location.reload();return;"></p:button>
						</ui:fragment>
						<p:spacer></p:spacer>
						<p:spacer></p:spacer>
					</h:panelGrid>
				</p:panel>
				<p:dataTable lazy="true" id="dataTable"
					value="#{orderDetailList.lazyModel}" var="orderDetail"
					paginator="true" paginatorPosition="bottom" rows="15"
					currentPageReportTemplate="#{commonMsg.pageReportTemplate}"
					paginatorTemplate="#{commonMsg.paginatorTemplate}"
					rowsPerPageTemplate="15,50,100"
					emptyMessage="啥也没有啊，是不是没人订啊，还是忘了结算了？">

					<ui:param name="ro" value="#{userOrderList.getReportOrder()}"></ui:param>

					<p:column>
						<f:facet name="header">
							<h:outputText value="谁订的"></h:outputText>
						</f:facet>
						<h:outputText value="#{orderDetail.user.realname}"></h:outputText>

					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="菜单编号"></h:outputText>
						</f:facet>
						<h:outputText value="#{orderDetail.cookbook.id}"></h:outputText>
					</p:column>
					<p:column rendered="#{orderDetail.breakfastDetail} ne null">
						<f:facet name="header">
							<h:outputText value="早餐订哪几天了"></h:outputText>
						</f:facet>
						<h:outputText value="#{orderDetail.breakfastDetail}"></h:outputText>
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="午餐订了哪几天"></h:outputText>
						</f:facet>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,0)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,1)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,2)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,3)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,4)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,5)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,6)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,7)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,8)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,9)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,10)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,11)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,12)}" />
					</p:column>
					<p:column>
						<h:outputText
							value="#{orderDetailList.getDetail(orderDetail.id,13)}" />
					</p:column>
					<f:facet name="footer">
						<p:commandButton value="导出Excel" ajax="false">
							<p:dataExporter target="dataTable" type="xls"
								fileName="orderDetail" pageOnly="false"></p:dataExporter>
						</p:commandButton>
					</f:facet>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
</ui:composition>
